package net.zigin.nhi.could.waste.service.impl;

import net.zigin.commons.util.ParamsMapUtil;
import net.zigin.commons.util.ReflectUtil;
import net.zigin.nhi.could.waste.dao.BaseMapper;
import net.zigin.nhi.could.waste.dao.SysDictionMapper;
import net.zigin.nhi.could.waste.model.SysDiction;
import net.zigin.nhi.could.waste.service.SysDictionService;
import net.zigin.nhi.could.waste.vo.SysDictionVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/*#################################################################*
# 说明:以下代码通过哲勤代码生成工具自动生成    
# 工具:GeneratorCode
# 作者:mgw1986                                                  
# 生成时间:2021-9-20 22:06:06                                               
##################################################################*/


/**
 * SysDiction服务实现类
 *
 * @author mgw1986
 * @version V1.0
 * @ClassName: SysDictionServiceImpl
 * @date 2021-9-20 22:06:06
 */
@Service
public class SysDictionServiceImpl extends AbstractServiceImpl<SysDiction, String> implements SysDictionService {
    @Autowired
    private SysDictionMapper sysDictionMapper;

    @Override
    public BaseMapper<SysDiction, String> getMapper() {
        return sysDictionMapper;
    }

    @Override
    public List<SysDictionVo> getListByType(String type) {
        Map<String, Object> paramMap = ParamsMapUtil.getInstance().addParam("type", type);
        List<SysDiction> sysDictions = sysDictionMapper.selectListByCondition(paramMap);
        return ReflectUtil.copyProperties(sysDictions, SysDictionVo.class);
    }
}